<?php

class ModuleController extends Controller {
    //获取菜单权限信息
    public function actionList() {
        $rm = RoleModule::model()->findAll("RoleID = ".Yii::app()->user->getState("role"));
        $arr = array();
        foreach ($rm as $r)
        {
            $crr = array();
            $m = Module::model()->findByPk($r->ModuleID);
            $crr["id"] = $m->ID;
            $crr["text"] = $m->Name;
            $crr["iconCls"] = $m->Icon;
            $crr["attributes"] = $m->Href;
            $arr[] = $crr;
        }
        $jt = json_encode($arr);
        echo $jt;exit;
    }
}